<!--
	소비자가 여는 모든 페이지의 header역할
	작성자:문연지
	작성일:2014/10/10
 -->

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>장돌뱅이 ~대한민국 전통시장을 응원합니다~</title>
<link href="/Jangdolbaeng2/css/customer/common1.css" rel="stylesheet">
<link href="/Jangdolbaeng2/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/Jangdolbaeng2/css/customer/common.css"/>
<style type="text/css">
 	#top{height: 20px; width:1050px; top:100px; margin:0 auto; text-align: right;}
 	#top_line{width:100%; height:0px; border-bottom:1px solid #bfbfbf;}
 	.top_atag{text-decoration: none; margin-top: 10px;}
 	#menu_top{ height:170px; width:1100px; margin:0 auto;}
 	#menu_center{margin: 0 auto; height:50px; width:1100px;}
 	#menu_main{position: relative; z-index:200; width:1100px;}
 	.menu_li{list-style: none; float: left;}
 	#menu_line {width: 100%; height: 40px; top: 202px; left: 0px; position:absolute; background-color:#ff6002; z-index:1;}
 	#topdiv_atag{ margin-top:10px; margin-bottom: 0px; bottom:0px;}
 	
 	
 	/*위에 부분*/
 	#div_menu_img{
 	}
 	#div_search{
 		position:absolute;
 		top:150px;
 		right:300px;
 		float:left;
 	}
 	
	/*따라오기기능*/ 	
 	#scroll{
		position:absolute;
		top:242px;
		right:0;
		text-align: center;
		z-index:200;
		font-family: anew;
		font-size:12pt;
		width:120px;
	}
	body{
		font-family: nanum;
	}
	
	a{
		color:black;
		
	}
	a:hover, a:focus{
		color:#ff6002;
	}
	.quick{
		width:120px;
		height:35px;
		background-color: #383838;
		color:white;
		padding-top:5px;
		font-size: 13pt;
	}
	.quick_menu{
		width:120px;
		height:35px;
		font-size: 15pt;
		font-family: fantasy;
	/* 	border-left: 1px solid #383838;
		border-right: 1px solid #383838;  */
	}
	
</style>
<script type="text/javascript" src="/Jangdolbaeng2/js/jquery-1.11.1.js"></script>
<script src="/Jangdolbaeng2/js/bootstrap.min.js"></script>
<script type="text/javascript">
function openLoginForm(){
	window.open("/Jangdolbaeng2/customer/goLoginForm.action", "loginWin", "width=800,height=380,top=300,left=500,scrollbars=no");
}

function logout(){
	if(confirm('로그아웃 하시겠습니까?')){
		location.href="/Jangdolbaeng2/customer/logout.action";
	} 
}
$(document).ready(function(){
	$(document).scroll(function(){
		var scroll = $(this).scrollTop();
		if(scroll > 242){
			$('#scroll').css({
				'position':'fixed',
				'top':40
			});
			$('#menu_main').css({
				'position':'fixed',
				'top':0
			})
			$('#menu_line').css({
				'margin':0,
				'margin':'auto',
				'position':'fixed',
				'top':0
			})
		}else{
			$('#scroll').css({
				'position':'absolute', 
				'top':242
			});
			$('#menu_line').css({
				'position':'absolute',
				'top':202
			})
			$('#menu_main').css({
				'position':'absolute',
				'top':202
			})
		}
	});
	
});

function goCart(){
	var customer_id = '${session.customer_id}';
	
	if(customer_id.length==0){
		if(confirm('로그인이 필요한 기능입니다. \n로그인 하시겠습니까?')){
			window.open("/Jangdolbaeng2/customer/goLoginForm.action", "loginWin", "width=800,height=380,top=300,left=500,scrollbars=no");
			return;		
		}else{
			return;
		}
	}
	
	location.href="/Jangdolbaeng2/customer/goCart.action";
}

function goSearch(){
	
	var keyword = $('#text_search').val();
	location.href = "/Jangdolbaeng2/product/goSearch.action?keyword="+keyword;
	
}

</script>
</head>
<body>
<form>
<div id="top">
	<div id="topdiv_atag" >
		<s:if test="#session.customer_id == null">
			<a href="javascript:openLoginForm()" class="top_atag" style="font-family:anew;">로그인</a>
		</s:if>
		<s:else>
			<a href="javascript:logout()" class="top_atag" style="font-family:anew;">로그아웃</a>
			<a href="/Jangdolbaeng2/customer/goCart.action" class="top_atag"style="font-family:anew;">장바구니</a>
			<a href="/Jangdolbaeng2/product/goDelivery.action" class="top_atag"style="font-family:anew;">주문/배송조회</a>
		</s:else>
	</div>
</div>
<div id="top_line"></div>
<div id="menu_top" align="center" >
	<div id="div_menu_img">
		<a href="/Jangdolbaeng2/product/main.action" >
		<img src="/Jangdolbaeng2/img/customer/logo3.png" alt="logo" id="logo_img"/></a>
	</div>
	<div id="div_search" style="float:left; font-style:anew;">
		<input type="text" size="20" id="text_search" style="float:left;">
  		<a href="javascript:goSearch()" 
  			style="font-size:12pt; padding-bottom:4px; padding-left:5px; padding-top:4px;float:left; font-family:anew;">
  		Search</a>
	</div>
</div>
<div id="menu_center">
	<div id="menu_line"></div>
	<div id="menu_main">
		<li class="menu_li"><img src="/Jangdolbaeng2/img/customer/shopping.png" alt="shopping"/></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=f"><img src="/Jangdolbaeng2/img/customer/fruit.png" alt="fruit"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=v"><img src="/Jangdolbaeng2/img/customer/vegetable.png" alt="vegetable"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=i"><img src="/Jangdolbaeng2/img/customer/fish.png" alt="fish"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=m"><img src="/Jangdolbaeng2/img/customer/meat.png" alt="meat"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=g"><img src="/Jangdolbaeng2/img/customer/groceries.png" alt="groceries"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=h"><img src="/Jangdolbaeng2/img/customer/health.png" alt="health"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=a"><img src="/Jangdolbaeng2/img/customer/fashion.png" alt="fashion"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=l"><img src="/Jangdolbaeng2/img/customer/life.png" alt="life"/></a></li>
		<li class="menu_li"><a href="/Jangdolbaeng2/product/goProductList.action?category=e"><img src="/Jangdolbaeng2/img/customer/etc.png" alt="etc"/></a></li>
	</div>
	<div id="menu_bottom"></div> 
</div>

<div id="scroll" style="background-color: white;">
	<div class="quick_menu" style="padding-top:5px;">
		QUICK
	</div>
	<div class="quick">
		우리 회원
	</div>
	<!-- 로그인 안 되어있을때 스크롤 바 -->
	<div id="sc_customer">
	<s:if test="#session.customer_id == null">
		<ul class="nav nav-pills">
			<li><a href="javascript:openLoginForm()" 
				style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:7px;padding-bottom:7px;">로그인</a></li>
		</ul>
	</s:if>
	<!-- 로그인 되어있을때 스크롤바!!!!!!!!!!!!! -->
	<s:else>
		<ul class="nav nav-pills  nav-stacked">
			<li><a href="javascript:logout()" 
				style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:7px;padding-bottom:7px;">로그아웃</a></li>
			<li><a href="/Jangdolbaeng2/customer/goCart.action" 
				style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:7px;padding-bottom:7px;">장바구니</a></li>
			<li><a href="/Jangdolbaeng2/product/goDelivery.action" 
				style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:7px;padding-bottom:7px;">주문/배송조회</a></li>
		</ul>
	</s:else>
	</div>
	<div class="quick">
		우리 시장
	</div>
	<div id="sc_marketinfo">
		<ul class="nav nav-pills nav-stacked">
			<li><a href="/Jangdolbaeng2/product/goInfo.action" style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:8px;padding-bottom:6px;">찾아오시는 길</a></li>
		</ul>
	</div>
	<div class="quick">
		우리 상점
	</div>
	<div id="sc_allshop">
		<ul class="nav nav-pills  nav-stacked">
			<li><a href="/Jangdolbaeng2/seller/blogList.action" style="width:120px;font-size:11pt;font-family:nanumBB;
				padding-top:7px;padding-bottom:7px; padding-left:4px; padding-right:4px;">
				전체 상점 보기</a></li>
			<li><div class="sc_thisshop"></div>
				</a></li>
		</ul>
	</div>
	<div class="quick">
			<a href="/Jangdolbaeng2/product/main.action" style="color:white;text-decoration: none">
				메인가기</a>
		</ul>
	</div>
	
</div>

</form>
</body>
</html>